---
title: Connect Migration Directories
id: directories
slug: /cloud/directories
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

import MigratePushCommand from '../components/migrate-push-command.mdx'

The following guide explains how to connect a migration directory to Atlas Cloud. Once connected, Atlas provides a list
of features enabling users to seamlessly audit their migration history, run continuous migration linting on their PRs,
monitor executed migrations and receive webhook notifications, among other capabilities.

To get started, you need to create the migration directory in Atlas Cloud.

### Login to Atlas Cloud

Firstly, you'll need to [log in to Atlas](https://auth.atlasgo.cloud/signup). If it's your first time, you'll be
prompted to create both an account and a workspace (organization):

<Tabs>
<TabItem value="web" label="Via Web">

```bash
atlas login
```

</TabItem>
<TabItem value="token" label="Via Token">

```bash
atlas login --token "ATLAS_TOKEN"
```

</TabItem>
<TabItem value="env-var" label="Via Environment Variable">

```bash
ATLAS_TOKEN="$ATLAS_TOKEN" atlas login
```

</TabItem>
</Tabs>

### Push the migration directory

After logging in, we can push the migration directory to Atlas Cloud to persist its state. This allows it to be read by
Atlas CLI later on in our CI/CD pipelines or by other developers on our team.

<MigratePushCommand/>

:::note
For the purpose of this example, we have named our migration directory `app`, but you can choose a
different name containing only alphanumeric characters, dashes, and underscores.
:::

<div style={{textAlign: 'center'}}>
    <img src="https://atlasgo.io/uploads/cloud/images/init-migration-dir.png" alt="atlas migrate push" width="100%"/>
    <p style={{fontSize: 12}}>Migration Directory created with <code>atlas migrate push</code></p>
</div>

### Setup CI

After setting up your migration directory, the next step is to add Atlas to your CI pipeline. This ensures that the
migration files are checked and reviewed before being merged into the main branch. Below are the supported CI platforms
Atlas currently supports:

- [GitHub Actions](/cloud/setup-ci#github-action-workflow)
- [GitLab CI](/guides/ci-platforms/gitlab)
- Using other CI platforms? [Let us know!](https://github.com/ariga/atlas/issues/new)


### Setup CD

Atlas Cloud streamlines deploying migrations by providing a single place to manage migrations for all your services.
After connecting your migration directory to Atlas Cloud, it is automatically synced to a central location on every
commit to your main branch. Once this setup (which takes less than one minute) is complete, you can deploy migrations
from Atlas Cloud to any environment with a single command (or using popular CD tools such as Kubernetes and Terraform).

For more information, visit the _Introduction to schema migrations deployments_ in the [guides section](/guides/deploying/intro).

### Slack Integration

You can use Slack Webhooks to receive updates in your Slack channel about schema changes, CI runs and deployment statuses of your migration directory.
Make sure you have a Slack incoming webhook configured
(you can create one [here](https://my.slack.com/services/new/incoming-webhook)).

Select your migration directory, go to "Webhooks" and click on **Add Webhook**.
<details>
<summary>Screenshot example</summary>

![](https://atlasgo.io/uploads/cloud/images/webhooks.png)

</details>


Select the Slack integration, Choose the events you want to be notified about and insert your webhook URL.
Click on **Add Webhook** to confirm.

Once the Webhook is created, you will be redirected to the Webhooks page.
Select a webhook to edit its configuration and to view its delivery history.
<details>
<summary>Screenshot example</summary>

![](https://atlasgo.io/uploads/cloud/images/manage-slack-webhook.png)

</details>

You can also test the webhook by clicking on `Send Ping`.
